<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <script src="./vue.js"></script>
    </head>
    <style>

    </style>
    <body>
        <div id="app">
            <!-- 这里用的是vue实例的的isShow  true-->
            <cpn v-show="isShow"></cpn>
        </div>
    </body>
    <template id="cpnC">
        <div>
            <h2>我是子组件</h2>
            <!-- 这是用的是子组件isShow  false 所以不显示-->
            <button v-show="isShow">按钮</button>
        </div>
    </template>
    <script>
        let app = new Vue({
            el:"#app",
            data:{
                msg:"你好啊",
                isShow:true
            },
            components: {
                cpn:{
                    template:"#cpnC",
                    data () {
                        return {
                            isShow:false
                        }
                    }
                }
            }
        })
    </script>
</html> 